﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OneMG.Phoenix.Service.Model;
using OneMG.Phoenix.Service.Contracts;
using OneMG.Phoenix.Service;

namespace OneMG.Phoenix.AdminSite.Views.Category
{

    public partial class Edit : System.Web.UI.Page
    {
        ICategoryService ICategory = new CategoryService();

        public IList<CategoryModel> CategoryList = new List<CategoryModel>();

        public CategoryModel objCategory;

        public int parentCategoryID;


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CategoryList = ICategory.GetByParentID(0);

               
                if (!string.IsNullOrEmpty(Request.QueryString["pid"]))
                {
                    parentCategoryID = int.Parse(Request.QueryString["pid"]);

                }

                if (!string.IsNullOrEmpty(Request.QueryString["cid"]))
                {
                    int cateID = int.Parse(Request.QueryString["cid"]);

                    objCategory = ICategory.GetByCategoryID(cateID);
                }

            }
            
        }

    }
}
